home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / mslang / stepon / example3.tx_ / example3.tx
Encoding:
Text File  |  1994-05-03  |  5.3 KB  |  164 lines

  1. ºplaywave.scpºLet "w", "{_WindowsDir}\xylophon.wav"
  2. FileExist "e", "{w}"
  3. If "{e}" = "0"
  4.     PathBox "w", "Please choose the WAVE file which should be played.", "", "{_WindowsDir}", "", "*.wav"
  5.     If "{w}" = ""
  6.         OutBox "No problem..."
  7.         End
  8.     EndIf
  9. EndIf
  10. PlayWave "{w}"
  11. If "{_err}" = "0"
  12.     OutBox "You hear the file '{w}'."
  13. Else
  14.     OutBox "Sorry, it isn't possible to play '{w}'."
  15. EndIf
  16. ºreboot.scpºMsgBox "i", "Do you want to restart Windows?", "", "&Yes;&No"
  17. If "{i}" = "1"
  18.     ReBoot
  19. Else
  20.     OutBox "No problem..."
  21. EndIf
  22. ºregbaser.scpºRegBaseRead "res1", ".FSC"
  23. RegBaseRead "res2", "{res1}"
  24. OutBox "The document with file extension {res1}{_NL} is named:{_NL}{res2}", "Document name"
  25. ºregbasew.scpºLet "k", "ShihTaoGame"
  26. RegBaseWrite ".GAM", "{k}"
  27. RegBaseWrite "{k}", "Shih Tao game file"
  28. RegBaseWrite "{k}\shell\open\command", "{_BootDrv}\ShihTao\ShihTao.Exe"
  29. RegBaseWrite "{k}\shell\open\ddeexec", "open %1"
  30. RegBaseWrite "{k}\shell\open\ddeexec\topic", "system"
  31. ºrem.scpºRem This is a comment.
  32. Rem This is also a comment.
  33. 'This is a comment too.
  34. Let "t", "This example demonstrates comments"
  35. 'OutBox "{t}", "result" 'In this line nothing 'comes
  36. OutBox "{t}", "result" 'This is a comment too.
  37. ºresstrgr.scpºResStringRead "r", "{_SystemDir}\commdlg.dll", "259"
  38. If "{_Err}" = "0"
  39.     OutBox "The 259th resource string of file COMMDLG.DLL is:{_NL}{r}"
  40. EndIf
  41. ºrmdir.scpºLet "Dir", "{_BootDrv}\stepone.tst"
  42. MkDir "{Dir}"
  43. If "{_Err}" = "0"
  44.     OutBox "{Dir} was created and will now be deleted."
  45.     RmDir "{Dir}"
  46. EndIf
  47. ºsendkeys.scpºSendKeys "%?B"
  48. ºsetattri.scpºPathBox "f", "Please enter the file you want to change the archive attribute.", "", "", "", "",  "-1"
  49. If "{f}" = ""
  50.     OutBox "No problem..."
  51.     End
  52. EndIf
  53. IsArchive "h", "{f}"
  54. SetArchive "{f}", "{h}"
  55. Let "t", "Archive bit was "
  56. If "{h}" = "0"
  57.     Let "w", "set."
  58.     Let "h", "-1"
  59. Else
  60.     Let "w", "deleted."
  61. EndIf
  62. Concat "t", "{w}.{_NL}Should it be reset?"
  63. MsgBox "i", "{t}", "", "&Yes;&No"
  64. If "{i}" = "1"
  65.     SetArchive "{f}", "{h}"
  66. EndIf
  67. ºsetwallp.scpºIniRead "OldWallpaper", "", "Desctop", "Wallpaper"
  68. IniRead "path", "win.ini", "krs", "StepOnePath"
  69. SetWallpaper "{path}\samples\install1.bmp"
  70. MsgBox "res", "Should it be undone{_nl}or should this file be the wallpaper{_nl}or don't you want to have a wallpaper?", "", "&Undo;&Use;&Delete"
  71. If "{res}" = "1"        
  72.     SetWallpaper "{OldWallpaper}"
  73. EndIf
  74. If "{res}" = "3"
  75.     SetWallPaper "{_nil}"
  76. EndIf
  77. ºsetwinp.scpºTextRead "tx", "setwinp1.txt"
  78. Window "-1", "SetWindowPosition", "Info", "{tx}", "-1", "0;0;1000;666"
  79. GetUserInput "Continue"
  80. TaskStart "WinHelp"
  81. SetWindowPosition "winhelp.exe", "0;667;1000;1000"
  82. GetUserInput "End"
  83. ºsplit.scpºLet "res", "Hello world, how are you?"
  84. Split "res", "{res}", " ", "3"
  85. 'Returns 'how'
  86. OutBox "{res}", "Result"
  87. ºsplitpat.scpºSplitPathName "res", "d:\krs\stepone\manual\man.sam", "3"
  88. 'Returns 'man'
  89. OutBox "{res}", "Result"
  90. ºsub.scpºGoSub "test", "abc"
  91. End
  92.  
  93. Sub test
  94.     Parameter "x"
  95.     OutBox "{test:x}"
  96. EndSub
  97. ºsysconst.scpºOutBox "Windows version is: {_WindowsVersion}.", "System"
  98. ºtable.scpºLet "tx", "{Test[1;1]}"
  99. Concat "tx", " {Test[1;2]}"
  100. Let "Test[1;3]", "!"
  101. Concat "tx", "{Test[1;3]}"
  102. OutBox "{tx}", "Table demonstration"
  103. ºtaskstop.scpºLet "prg", "Write.Exe"
  104. Window "-1", "StepOne-Test", "Info", "Press 'Continue' to close '{prg}'.", "-1", "10;10;990;900"
  105. GetUserInput "Continue"
  106. TaskStop "{prg}"
  107. ºtaskstrt.scpºLet "prg", "Write.Exe"
  108. Window "-1", "StepOne-Test", "Info", "Press 'Continue' to start '{prg}'.", "-1", "10;10;990;900"
  109. GetUserInput "Continue"
  110. TaskStart "{prg}"
  111. If "{_Err}" = "-1"
  112.     Window "-1", "", "Error", "'{prg}' couldn't be started."
  113. Else
  114.     Window "-1", "", "Success", "'{prg}' was started."
  115. EndIf
  116. GetUserInput "End"
  117. ºtextread.scpºTextRead "res", "{_BootDrv}\AUTOEXEC.BAT", "-1"
  118. OutBox "{res}", "AUTOEXEC.BAT"
  119. ºtextwrit.scpºTextRead "res", "{_BootDrv}\AUTOEXEC.BAT", "-1"
  120. TextWrite "textwrit.tmp", "{res}", "", "-1"
  121. OutBox "textwrit.tmp", "AUTOEXEC.BAT as TEXTWRIT.TMP."
  122. ºtouch.scpº' Changes the date of file 'TOUCH.FSC' to the given date.
  123. ' Warning: The new file date isn't immediately accessable.
  124. ' Windows File Manager needs i.e. a refresh to reread the directory.
  125. Touch "{_appname}", "1/1/1994", "0:0:0"ºvariable.scpºLet "prg", "MyProg"
  126. Let "prgpath", "{_BootDrv}\{Prg}"
  127. OutBox "{prg} will be installed in path {prgpath}."
  128. ºcompare.scpºIf "{_TempDir}" =: "{_WindowsDir}"
  129.     Let "t", "Your TEMP directory isn't on the same drive as your Windows directory."
  130. Else
  131.     Let "t", "Your TEMP directory is on the same drive as your Windows directory."
  132. EndIf
  133. OutBox "{t}"
  134. ºverinfor.scpºLet "f", "{_WindowsDir}\write.exe"
  135. VersionInfoRead "res", "{f}", "FileDescription"
  136. OutBox "{res}", "Copyright of MS Write"
  137. ºwait.scpºAskBox "t", "How many seconds should StepOne wait?"
  138. If "{t}" <> ""
  139.     Compute "", "{t}" + "2"
  140.     If "{_Err}" = "0"
  141.         Wait "+{t}"
  142.         OutBox "StepOne has waited for {t} seconds."
  143.     Else
  144.         OutBox "You haven't entered a digit."
  145.     EndIf
  146. EndIf
  147. ºwindow.scpºLet "t", "StepOne test"
  148. Window "-1", "{t}", "Info", "Press 'End' to end '{t}'.", "-1", "10;10;990;900"
  149. GetUserInput "&End"
  150. ºwinhelp.scpºOutBox "StepOne starts now the help system of Windows."
  151. WinHelp "{_WindowsDir}\winhelp.hlp"
  152. ºgettabc.tabºTable Test
  153. EndTable
  154. ºgettabec.tabºTable Test
  155.     "Test1", "Test2"
  156. EndTable
  157. ºgettablc.tabºTable Test
  158.     "Test1", "Test2"
  159.     ""
  160. EndTable
  161. ºtable.tabºTable Test
  162.     "Hello", "World", ""
  163. EndTable
  164.